How to sum and divide in MySql [migrated]
Posted
by
Nick
on Programmers
See other posts from Programmers
or by Nick
Published on 2012-06-25T12:59:19Z
Indexed on
2012/06/25
21:23 UTC
Read the original article
Hit count: 222
Alright, so I have a user table and would like to get the max value for the user with the highest amount of points divided by a score. Below is a rough idea of what I'm looking for:
SELECT MAX(SUM(points)/SUM(score)) FROM users
I'm not interested in adding up both columns and dividing, rather I'm interested in dividing the points and score for each user and retrieve the highest value out of the lot.
© Programmers or respective owner